#ifndef _PID_H
#define _PID_H

typedef struct _PID
{
	float kp,ki,kd;
	float error,lastError;
	float integral,maxIntegral;
	float output,maxOutput;
}PID;

void PID_Init(PID *pid,float p,float i,float d,float maxI,float maxOut);
void PID_SingleCalc(PID *pid,float reference,float feedback);
void PID_Clear(PID *pid);

#endif